# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=liblqr
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.4.3
pkgrel=1
pkgdesc="A seam-carving C/C++ library called Liquid Rescale (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://liblqr.wikidot.com/"
msys2_repository_url='https://github.com/carlobaldassi/liblqr/'
msys2_references=(
  'purl: pkg:github/carlobaldassi/liblqr'
)
license=("spdx:LGPL-2.1-or-later OR GPL-2.1-or-later")
depends=("${MINGW_PACKAGE_PREFIX}-glib2")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-autotools")
source=(https://github.com/carlobaldassi/liblqr/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz)
sha256sums=('64b0c4ac76d39cca79501b3f53544af3fc5f72b536ac0f28d2928319bfab6def')

build() {
  mkdir -p "build-${MSYSTEM}" && cd "build-${MSYSTEM}"

  ../"${_realname}-${pkgver}"/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --enable-shared \
    --enable-static

  make
}

package() {
  cd "build-${MSYSTEM}"
  make DESTDIR="${pkgdir}" install
}
